import Vue from 'vue'
import VueI18n from 'vue-i18n'
import elementEN from 'element-ui/lib/locale/lang/en'
import elementZH from 'element-ui/lib/locale/lang/zh-CN'
import Cookies from 'js-cookie'
import customZH from './zh'
import customEN from './en'

Vue.use(VueI18n)
export default new VueI18n({
  locale: Cookies.get('language') || 'zh', // 从cookies中获取语言类型，获取不到就是中文
  messages: {
    'en': {
      ...elementEN,
      ...customEN
    },
    'zh': {
      ...elementZH,
      ...customZH
    }  
  }
})
